// $http.get('server/datatable.json')
//     .success(function (data) {
//     console.log(data);
//         $scope.persons = data;
// });
App.controller('BatchNewsController', ['$scope', '$resource','$http',
    function($scope, $resource,$http) {
        'use strict';
        $scope.todayNewsModel = {
            "news_basic_net_name":"",
            "a_text":"",
            "update_time":""
        }

        $scope.checkTodayNews = function(_todayNewsModel){
            console.log(_todayNewsModel)
            $http({
                "method": 'POST',
                "url": '/man/mycode/news/getCount',
                "data":_todayNewsModel
            }).then(
                function successCallback(value) {
                    console.log("=====================")
                    console.log(value)
                    if (value.data > 0){
                        $scope.getNews( _todayNewsModel )
                    }
                    console.log("---------------------")
                },function errorCallback(reason) {
                    console.log(reason)
                    console.log("pppppppppppppppppppppppppppppp")
                })
        }

        $scope.getNews = function(_data){
            $http({
                "method": 'POST',
                "url": '/man/mycode/news/getNews',
                "data":_data
            }).then(function successCallback(value) {
                $scope.newsInfo = value.data
                    console.log(value)
                },
                function errorCallback(reason) {
                    console.log(reason)
                })
        }



    }]);